local skel = fk.CreateSkill {
  name = "emo__liyu",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["emo__liyu"] = "利驭",
  [":emo__liyu"] = "锁定技，你杀死角色的奖惩改为令所有其他角色依次选择令你回一点体力或摸一张牌。",

  ["#emo__liyu-choice"] = "利驭：选一项令 %Src 执行",

  ["$emo__liyu1"] = "功名利禄！吾皆求之。",
  ["$emo__liyu2"] = "有利得之，有何不敢！",
}

skel:addEffect(fk.BuryVictim, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(skel.name) and data.killer == player and not ((data.extra_data or {}).skip_reward_punish)
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    data.extra_data = data.extra_data or {}
    data.extra_data.skip_reward_punish = true
    local targets = room:getOtherPlayers(player)
    room:doIndicate(player, targets)
    for _, p in ipairs(targets) do
      if player.dead then return end
      if not p.dead then
        local draw = true
        if player:isWounded() then
          draw = room:askToChoice(p, {
            skill_name = skel.name, choices = {"recover", "draw1"},
            prompt = "#emo__liyu-choice:"..player.id,
          }) == "draw1"
        end
        if draw then
          player:drawCards(1, skel.name)
        else
          room:recover { num = 1, skillName = skel.name, who = player, recoverBy = p }
        end
      end
    end
  end,
})

return skel
